package Test6.PETSHOP;

public abstract class PetImpl implements Pet{
    String name;
    int age;
    public PetImpl(){
        this.name=null;
        this.age=0;
    }
    public PetImpl(String name,int age){
        this.name=name;
        this.age=age;
    }
    @Override
    public String toString(){
        return ("name:"+this.name+" "+"age:"+this.age);
    }
    @Override
    public boolean equals(Object obj){
        if(obj instanceof PetImpl p){
            if(this.name.equals(p.name)&&this.age==p.age){
                return true;
            }
        }
        return false;
    }
    @Override
    public String getName(){
        return this.name;
    }
    @Override
    public int getAge(){
        return this.age;
    }
}
